import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { AuthModule } from './auth/auth.module';
import { UsersModule } from './users/users.module';
import { TypeOrmModule } from '@nestjs/typeorm';
import { Bk_User } from './users/bk_user.entity';
import { SubjectController } from './subject/subject.controller';
import { SubjectService } from './subject/subject.service';
import { Bk_Subject } from './subject/bk_subject.entity';
import { SeriesController } from './series/series.controller';
import { SeriesService } from './series/series.service';
import { Bk_Series } from './series/bk_series.entity';
import { ProductController } from './product/product.controller';
import { ProductService } from './product/product.service';
import { Bk_Product } from './product/bk_product.entity';
import { OrderController } from './order/order.controller';
import { OrderService } from './order/order.service';
import { Bk_Order } from './order/bk_order.entity';
import { UndergraduateController } from './undergraduate/undergraduate.controller';
import { UndergraduateService } from './undergraduate/undergraduate.service';
import { Bk_Undergraduate } from './undergraduate/bk_undergraduate.entity';
import { JuniorCollegeController } from './junior_college/junior_college.controller';
import { JuniorCollegeService } from './junior_college/junior_college.service';
import { Bk_Junior_College } from './junior_college/bk_junior_college.entity';
import { DisciplineController } from './discipline/discipline.controller';
import { DisciplineService } from './discipline/discipline.service';
import { Bk_Discipline } from './discipline/bk_discipline.entity';
import { ProductInfoController } from './product_info/product_info.controller';
import { ProductInfoService } from './product_info/product_info.service';
import { Bk_Product_Info } from './product_info/product_info.entity';
import { OutstandingStudentsController } from './outstanding_students/outstanding_students.controller';
import { OutstandingStudentsService } from './outstanding_students/outstanding_students.service';
import { CurriculumStructureController } from './curriculum_structure/curriculum_structure.controller';
import { CurriculumStructureService } from './curriculum_structure/curriculum_structure.service';
import { NewsController } from './news/news.controller';
import { NewsService } from './news/news.service';
import { Bk_Curriculum_Structure } from './curriculum_structure/bk_curriculum_structure.entity';
import { CourseCategoryController } from './course_category/course_category.controller';
import { CourseCategoryService } from './course_category/course_category.service';
import { Bk_Course_Category } from './course_category/bk_course_category.entity';
import { Bk_Outstanding_Students } from './outstanding_students/bk_outstanding_students.entity';
import { Bk_News } from './news/bk_news.entity';
import { NewsCategoryController } from './news_category/news_category.controller';
import { NewsCategoryService } from './news_category/news_category.service';
import { Bk_News_Category } from './news_category/bk_news_category.entity';
import { PayController } from './pay/pay.controller';
import { PayService } from './pay/pay.service';
import { PayNoticeController } from './pay_notice/pay_notice.controller';
import { PayNoticeService } from './pay_notice/pay_notice.service';
import { UtilsService } from './utils/utils.service';
import { FileManageController } from './file_manage/file_manage.controller';
import { FileManageService } from './file_manage/file_manage.service';
import { Bk_File_Manage } from './file_manage/bk_file_manage.entity';
import { WechatController } from './wechat/wechat.controller';
import { WechatService } from './wechat/wechat.service';
import { Bk_Student_Info } from './student_info/bk_student_info.entity';
import { StudentInfoController } from './student_info/student_info.controller';
import { StudentInfoService } from './student_info/student_info.service';
import { Bk_Banner } from './banner/entities/bk_banner.entity';
import { BannerController } from './banner/banner.controller';
import { BannerService } from './banner/banner.service';

@Module({
  imports: [
    UsersModule,
    AuthModule,
    TypeOrmModule.forFeature([
      Bk_User,
      Bk_Subject,
      Bk_Series,
      Bk_Product,
      Bk_Order,
      Bk_Undergraduate,
      Bk_Junior_College,
      Bk_Discipline,
      Bk_Product_Info,
      Bk_Curriculum_Structure,
      Bk_Course_Category,
      Bk_Outstanding_Students,
      Bk_News,
      Bk_News_Category,
      Bk_File_Manage,
      Bk_Student_Info,
      Bk_Banner
    ]),
    TypeOrmModule.forRoot({
      type: 'mysql',
      host: 'localhost',
      port: 3306,
      username: 'root',
      password: 'root',
      database: 'bk_edu',
      entities: [
        Bk_User,
        Bk_Subject,
        Bk_Series,
        Bk_Product,
        Bk_Order,
        Bk_Undergraduate,
        Bk_Junior_College,
        Bk_Discipline,
        Bk_Product_Info,
        Bk_Curriculum_Structure,
        Bk_Course_Category,
        Bk_Outstanding_Students,
        Bk_News,
        Bk_News_Category,
        Bk_File_Manage,
        Bk_Student_Info,
        Bk_Banner
      ],
      autoLoadEntities: true,
      synchronize: true
    }),
  ],
  controllers: [
    AppController,
    SubjectController,
    SeriesController,
    ProductController,
    OrderController,
    UndergraduateController,
    JuniorCollegeController,
    DisciplineController,
    ProductInfoController,
    OutstandingStudentsController,
    CurriculumStructureController,
    NewsController,
    CourseCategoryController,
    NewsCategoryController,
    PayController,
    PayNoticeController,
    FileManageController,
    WechatController,
    StudentInfoController,
    BannerController
  ],
  providers: [
    AppService,
    SubjectService,
    SeriesService,
    ProductService,
    OrderService,
    UndergraduateService,
    JuniorCollegeService,
    DisciplineService,
    ProductInfoService,
    OutstandingStudentsService,
    CurriculumStructureService,
    NewsService,
    CourseCategoryService,
    NewsCategoryService,
    PayService,
    PayNoticeService,
    UtilsService,
    FileManageService,
    WechatService,
    StudentInfoService,
    BannerService
  ],
  exports: [TypeOrmModule]
})
export class AppModule { }